
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.caotv.wkreport.dao.Rooms"%>
<%@page import="java.util.List"%>
<%@page import="com.caotv.wkreport.dao.User"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<html>
<head>
<title>Rooms List</title>
<script type="text/javascript">
 	  function kt(){  
         	var   roomnameKT =  document.getElementById("roomId").value;
      	     if(roomnameKT=="-1"){
       	        	alert(" Please select room name!");
                	return false;
                }  
    	 	 var startDay = document.getElementById("startDate").value;
 		     if(startDay==""){
 		        	alert(" Please select startDay!");
     	     	return false;
     	     }   
 		  	 var endDay = document.getElementById("endDate").value;
		     if(endDay==""){
		        	alert(" Please select endDate!");
  	  		   	return false;
  	 	    }
		    if(startDay > endDay) {
		        	alert(" Please select startDate and endDate ");
		        	return false;
		        }
                return true;
            }
        </script>
        
<sx:head />
<sj:head />



        
</head>

<body>
	<div id="functionLabel">
		Room Booking Information
	</div>
<div id="bookRoomForm">
		<s:form action="BookingRoomInfoAction" method="post" validate="true"
			theme="simple">
			<table>		
				<tr>
					<td><s:label key="label.room"></s:label></td>
					<td colspan="5"><s:select list="listRooms" listKey="id"
							listValue="roomname" name="roomId" headerKey="-1" id="roomId"
							key="label.room" headerValue="Choose a room">
						</s:select></td>
				</tr>
			
				<tr>
					<td colspan="6"><s:fielderror fieldName="startDate"></s:fielderror>
					</td>
				</tr>
				<tr>
					<td><s:label key="label.startDate"></s:label></td>
					<td>
						<sj:datepicker id="startDate" displayFormat="mm/dd/yy"
							name="startDate" key="label.startDate" />
					</td>
				</tr>
				<tr>
					<td colspan="6"><s:fielderror fieldName="endDate"></s:fielderror>
					</td>
				</tr>
				<tr>
					<td><s:label key="label.endDate"></s:label></td>

					<td><sj:datepicker id="endDate" name="endDate"
							key="label.endDate" displayFormat="mm/dd/yy" /></td>
				</tr>
				<tr>
					<td colspan="6"><s:submit cssClass="button"
							key="View" align="center" onclick="return kt()"/></td>
				</tr>
			</table>
		</s:form>
	</div>

	<table id="customers">
		<tr class="even">
			<th>Roomname</th>
			<th>Floor</th>
			<th>RoomNumber</th>
			<th>Building</th>
			<th>Status</th>
			</tr>
		<s:iterator value="listRooms" status="roomStatus" id="listRooms">
			<s:if test="#roomStatus.even == true">
				<tr class="evenRow">
			</s:if>
			<s:else>
				<tr class="oddRow">
			</s:else>
			<td><s:property value="roomname" /></td>
			<td><s:property value="floor" /></td>
			<td><s:property value="roomNumber" /></td>
			<td><s:property value="building" /></td>
			<td><s:property value="status" /></td>
			
			</s:iterator>
	</table>
</body>
</html>